<div class="offcanvas-header">
	<h6 class="text-white">
		<i class="bi bi-grid"></i>商品进货供应商排行
	</h6>
	<i class="bi bi-x-square-fill" style="font-size: 1.5rem; color: #ffffff; cursor: pointer;" data-bs-dismiss="offcanvas" aria-label="Close"></i>
</div>
<div class="offcanvas-body pt-1">
	<div class="card">
		<div class="card-body" style="padding: 1rem 1rem;">
			<div class="row">
				<div class="col-3">
					<span class="text-secondary">商品：</span><span class="text-secondary fw-bold">#(goodsInfo.name)</span>
				</div>
				<div class="col-6">
					<span class="text-secondary">日期：</span><span>#(startTime) ~ #(endTime)</span>
				</div>
			</div>
			
		</div>
	</div>

	<div class="card mt-2">
		<div class="card-body">
			<div class="row text-center align-items-center">
				<div class="col right-border">
					<span class="fw-bold text-secondary">商品进货额</span><br> <span class="fs-6 fw-bold text-secondary">￥#number(sumOrder.amount??0, "#.##")</span>
				</div>
				<div class="col right-border">
					<span class="fw-bold text-secondary">进货商品数</span><br> <span class="fs-6 fw-bold text-secondary">#number(sumOrder.buy_number??0, "#.####")</span>
				</div>
				<div class="col right-border">
					<span class="fw-bold text-secondary">退款商品数<i class="bi bi-question-circle text-secondary" style="font-size:13px" data-bs-toggle="tooltip" data-bs-placement="top" title="如果存在未进货，但有退货的情况，会存在误差"></i></span><br> <span class="fs-6 fw-bold text-warning">#number(sumOrder.reject_number??0, "#.####")</span>
				</div>
				<div class="col">
					<span class="fw-bold text-secondary">退款总额</span><br> <span class="fs-6 fw-bold text-warning">￥#number(sumOrder.reject_amount??0, "#.##")</span>
				</div>
			</div>
		</div>
	</div>
	
	<form id="statPurchaseGoods-show-search-form">
	<input type="hidden" id="statPurchaseGoods_show_pageNumber" name="pageNumber">
	</form>
	<div id="statPurchaseGoods_showList">
	</div>
	
</div>

<script type="application/javascript">
	
$(function() {
	// 初始化bootstrap相关组件
	common.initBootstrap();
	statPurchaseGoods.showList();
});

statPurchaseGoods.showList = function(callback) {
	beekit.ajaxFillPage("/inventory/stat/purchaseGoods/showSupplierList?goods_info_id=#(goodsInfo.id)&start_time=#(startTime??)&end_time=#(endTime??)", "#statPurchaseGoods-show-search-form", "#statPurchaseGoods_showList" ,"", callback);
};

</script>

